package com.example.smartcity_40.home

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.example.smartcity_40.R
import com.google.android.material.bottomnavigation.BottomNavigationView

class Jump(private val mainNav: BottomNavigationView) : BroadcastReceiver() {
    override fun onReceive(p0: Context?, p1: Intent?) {
        val action = p1?.action
        if ("jump" == action) {
            val intent = Intent("jump")
            LocalBroadcastManager.getInstance(p0!!).sendBroadcast(Intent("com.example.smartcity_40.JUMP"))
            mainNav.selectedItemId = R.id.nav_service
        }
    }
}